<template>
  <Line :loading="loading" :chartData="chartData" title="本周期数据" />
</template>
<script lang="ts"
  setup>
  import { getQoqData } from '@/api/dataReport/deviceParamReport'
  import { ref } from "vue";
  import Line from '@/components/Charts/Line/index.vue'

  const loading = ref(true)
  const chartData = ref({
    xaxisList: [],
    yaxisList: [],
  },)

  const getData = (searchInfo) => {
    getQoqData(searchInfo).then(res => {
      chartData.value = res
    }).catch(e => {
      chartData.value = {
        xaxisList: [],
        yaxisList: [],
      }
    }).finally(() => {
      loading.value = false
    })
  }

  defineExpose({
    getData,
  })


</script>
